<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" type="text/css" href="__HOME__/css/zhuche.css"/>
	<script type="text/javascript" src="__HOME__/js/jquery.min.js"></script>
	<!-- <script src="__HOME__/js/formyz.js"></script> -->
	<title>注册页面</title>
</head>
<body>
	<div class="wrap">
		<div class="header">
			<div class="header-l">
				<img src="__HOME__/images/top_arrowleft.png" alt="" />
			</div>
			<p>注册</p>
		</div>
		
		<div class="row">
			<div class="zcinfo">
				<form method="post">
					<input id="nickname" class="one" type="text" name="" value="" placeholder="用户名/手机号" />
					<input class="two" type="password" name="" id="password" value="" placeholder="密码" />
					<input class="three" type="password" name="" id="twopassword" value="" placeholder="再次输入密码" />
				</form>
				<input id="submitBtn" class="tob" type="submit"  value="注册" />
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="__HOME__/layer/layer.js"></script>
<script>
	
	$(function(){
		
		$('#submitBtn').click(function(){
			if(!$('#nickname').val()){
				
				layer.msg("用户名不能为空")
				return
			}
			if(!$('#password').val()){
				
				layer.msg("密码不能为空")
				return
			}
			if($('#password').val() != $('#twopassword').val()){
				
				layer.msg("两次次输入密码不一致")
				return
			}
			
			
			var user_id = "{$user_id}";
			
			if(user_id){
				var url= "{:url('zhuce1')}"
			}else{
				var url= "{:url('zhuche')}"
			}
			

	
			$.post(url,{
				nickname:$('#nickname').val(),
				password:$('#password').val(),
				parentid:user_id
			},function(res){
				if(res.code>0){
			 layer.msg(res.msg,{}, function () {
                            location.href = res.url;
                        });
				}else{
					
					layer.msg(res.msg)
				}
				
				
			})
					
			
		})
		
		
	})
	
	
</script>


</html>